<script>
  export default {
    props: {
      unit: {
        type: String,
        default: ''
      }
    },
    data() {
      return {
        uniting: ''
      }
    },
    mounted() {
      this.$nextTick(() => {
        this.resUnit(this.unit)
      })
    },
    methods: {
      resUnit(unit) {
        switch (unit) {
          case 'precent':
            this.uniting = '%'
            break;
          case 'number':
            this.uniting = ''
            break;
          default:
            this.uniting = unit
        }
      }
    },
    render(h) {
      return h('span',{
        style: {
          color: '#999'
        }
      }, this.uniting)
    }
  }
</script>

<style scoped>

</style>